﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.ObjectModel;
namespace Skynet.SLAdministration.Views.MgmCategories
{    
    public partial class CreateCategoryView : ChildWindow
    {
        public CreateCategoryView()
        {
            InitializeComponent();
            this.Loaded += new RoutedEventHandler(CreateCategoryView_Loaded);
        }
        void CreateCategoryView_Loaded(object sender, RoutedEventArgs e)
        {                    
        }
        private MgmCategoriesPresenter _Presenter;
        public MgmCategoriesPresenter Presenter { 
            get{return this._Presenter;}
            set{this._Presenter = value; this.DataContext = value;}
        }        
        private void dfCategory_EditEnded(object sender, DataFormEditEndedEventArgs e)
        {
            if (this.dfCategory.CurrentItem != null)
            {
                BusinessEntities.ExamCategory cat = this.dfCategory.CurrentItem as BusinessEntities.ExamCategory;                
                this.Presenter.SaveChange();                
            }
        }
        private void ChildWindow_Closed(object sender, EventArgs e)
        {
            
        }
    }
}